<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var fullName = 'language';
        var obj = {
            fullName: 'javascript',
            prop: {
                getFullname: function() {
                    return this.fullName;
                }
            }
        };

        console.log(obj.prop.getFullname()); //undefined   this为prop
        var test = obj.prop.getFullname;
        console.log(test()); //language       this为window 相当于window.test = getFullname;
    </script>
</body>

</html>